home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 1 / Cream of the Crop 1.iso / PROGRAM / DBVGAL17.ARJ / SRC_ASM.ARJ / VPUTS.ASM < prev    next >
Assembly Source File  |  1992-01-25  |  2KB  |  86 lines

  1. ;        NAME    vputs
  2. ; Function:     Call IBM ROM BIOS to display a string in graphics mode
  3. ; Caller:       C:
  4. ;               int putstty(const char *s, unsigned char color);
  5. ARGS            equ     dword ptr [bp+06]
  6. ARGS_s          equ     word ptr [bp+08]
  7. ARGS_o          equ     word ptr [bp+06]
  8. ARGC            equ     byte ptr [bp+0ah]
  9. ;
  10. ARGX            equ     byte ptr [bp+06]
  11. ARGY            equ     byte ptr [bp+08]
  12. ;
  13. VPUTS_TEXT       SEGMENT byte public 'CODE'
  14.                 public _putstty
  15.                 ASSUME  cs:VPUTS_TEXT
  16. ;
  17. _putstty        PROC    far
  18.                 push    bp
  19.                 mov     bp,sp
  20.                 push    es
  21.                 push    si
  22.                 pushf
  23.                 cld
  24.                 les     si,ARGS
  25.                 mov     al,ARGC
  26.                 mov     bl,al
  27.                 mov     ah,0eh
  28.  
  29.     @again:     ;     
  30.                 lodsb               ; mov  al,es:[si]
  31.                 cmp     al,0    
  32.                 jz      @out
  33.                 int     10h
  34.                 jmp     @again
  35.  
  36.     @out:       xor     ah,ah
  37.                 dec     si
  38.                 lodsb
  39.                 popf
  40.                 pop     si
  41.                 pop     es
  42.                 pop     bp
  43.                 ret
  44. _putstty        endp
  45.                 public _Vputs
  46.                 ; int Vputs(char *s)
  47.                 extrn __foreground_color:BYTE
  48. _Vputs          PROC    far
  49.                 push    bp
  50.                 mov     bp,sp
  51.                 push    es
  52.                 push    si
  53.                 pushf
  54.                 cld
  55.                 les     si,ARGS
  56.                 mov     bl,__foreground_color
  57.                 mov     ah,0eh
  58.  
  59.                 jmp     @again          ; jump into _putstty
  60.  
  61. _Vputs          endp
  62.                 ;
  63.                 public _Vgotoxy
  64. ;
  65. _Vgotoxy        PROC    far
  66.                 push    bp
  67.                 mov     bp,sp
  68.                 push    ds
  69.  
  70.                 xor     ax,ax
  71.                 mov     ds,ax
  72.                 mov     bh,ds:[0462h]   ; assume current display page
  73.                 mov     ah,02
  74.                 mov     dh,ARGY
  75.                 mov     dl,ARGX
  76.                 int     10h
  77.  
  78.                 pop     ds
  79.                 pop     bp
  80.                 ret
  81. _Vgotoxy        endp
  82. ;
  83. VPUTS_TEXT      ENDS
  84.                 END
  85.  
  86.